package com.eorchis.module.department.domain;

import com.eorchis.api.IOrganization;
import com.eorchis.core.basedao.entity.IBaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "BASE_DEPARTMENT")
public class Department implements IOrganization, IBaseEntity {
	private static final long serialVersionUID = 1L;
	public static final Integer COMPANY_LEVEL_GROUP = new Integer(1);

	public static final Integer COMPANY_LEVEL_HEADQUARTERS = new Integer(2);

	public static final Integer COMPANY_LEVEL_PROVINCE = new Integer(3);

	public static final Integer COMPANY_LEVEL_CITY = new Integer(4);

	public static final Integer IS_ACTIVE_Y = Integer.valueOf(1);

	public static final Integer IS_ACTIVE_N = Integer.valueOf(2);

	public static final Integer DEPT_KIND_TYPE_COMPANY = new Integer(1);
	
	public static final Integer DEPT_TYPE_THREE = new Integer(3);//三级单位

	public static final Integer DEPT_KIND_TYPE_DEPARTMENT = new Integer(2);
	public static final String ROOT_DEPARTMENT_ID = "-1";
	private String deptID;
	private String deptName;
	private String deptCode;
	private String deptAddress;
	private String deptPostNum;
	private String deptPhone;
	private Integer orderNum;
	private String deptKindCode;
	private String treepath;
	private String parentID;
	private String reportDeptID;
	private Integer activeState;
	private Integer orderNum2; 
	private String adminLevelCode;// 部门级别

	@Id
	@Column(name = "DEPID")
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	public String getDeptID() {
		return this.deptID;
	}

	public void setDeptID(String deptID) {
		this.deptID = deptID;
	}

	@Column(name = "DEPNAME")
	public String getDeptName() {
		return this.deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	@Column(name = "DEPT_ADDRESS")
	public String getDeptAddress() {
		return this.deptAddress;
	}

	public void setDeptAddress(String deptAddress) {
		this.deptAddress = deptAddress;
	}

	@Column(name = "DEPT_POST_NUM")
	public String getDeptPostNum() {
		return this.deptPostNum;
	}

	public void setDeptPostNum(String deptPostNum) {
		this.deptPostNum = deptPostNum;
	}

	@Column(name = "DEPT_PHONE")
	public String getDeptPhone() {
		return this.deptPhone;
	}

	public void setDeptPhone(String deptPhone) {
		this.deptPhone = deptPhone;
	}

	@Column(name = "ORDER_NUM")
	public Integer getOrderNum() {
		return this.orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	@Column(name = "DEPKIND_CODE")
	public String getDeptKindCode() {
		return this.deptKindCode;
	}

	public void setDeptKindCode(String deptKindCode) {
		this.deptKindCode = deptKindCode;
	}

	@Column(name = "TREEPATH")
	public String getTreepath() {
		return this.treepath;
	}

	public void setTreepath(String treepath) {
		this.treepath = treepath;
	}

	@Column(name = "PARENT_ID")
	public String getParentID() {
		return this.parentID;
	}

	public void setParentID(String parentID) {
		this.parentID = parentID;
	}

	@Column(name = "REPORT_DEPID")
	public String getReportDeptID() {
		return this.reportDeptID;
	}

	public void setReportDeptID(String reportDeptID) {
		this.reportDeptID = reportDeptID;
	}

	@Column(name = "ACTIVE_STATE")
	public Integer getActiveState() {
		return this.activeState;
	}

	public void setActiveState(Integer activeState) {
		this.activeState = activeState;
	}

	@Column(name = "DEPCODE")
	public String getDeptCode() {
		return this.deptCode;
	}

	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}

	public String toString() {
		return "主键======>" + getDeptID() + "\n公司名称======>" + getDeptName() + "\n公司编码======>" + getDeptCode() + "\n单位电话号码======>" + getDeptPhone() + "\n树路径======>" + getTreepath() + "\n父级单位ID======>"
				+ getParentID() + "\n活动状态======>" + getActiveState() + "\n排序编号======>" + getOrderNum();
	}

	@Transient
	public String getID() {
		return this.deptID;
	}

	public void setID(String id) {
		this.deptID = id;
	}

	@Transient
	public String getName() {
		return this.deptName;
	}

	public void setName(String name) {
		this.deptName = name;
	}

	@Transient
	public String getCode() {
		return this.deptCode;
	}

	public void setCode(String code) {
		this.deptCode = code;
	}

	@Column(name = "admin_Level_Code")
	public String getAdminLevelCode() {
		return adminLevelCode;
	}

	public void setAdminLevelCode(String adminLevelCode) {
		this.adminLevelCode = adminLevelCode;
	}

	@Column(name="customfield6")
	public Integer getOrderNum2() {
		return orderNum2;
	}

	public void setOrderNum2(Integer orderNum2) {
		this.orderNum2 = orderNum2;
	}
}